#ifndef GENERAL_H
#define GENERAL_H

#include <qgl.h>

#include "shuttle.h"
#include "tiles.h"
#include "scene.h"
#include "decorations.h"
#include "hud.h"
#include "main_menu.h"

#include "gatling_bullet.h"
#include "cannon_bullet.h"

#include "stage_text.h"
#include "to_be_continued_text.h"

#include "enemy_1.h"
#include "rocket_1.h"

#include "enemy_2.h"
#include "rocket_2.h"

#include "enemy_3.h"
#include "laser.h"

#include "enemy_4.h"
#include "bullet_1.h"

#include "enemy_5.h"

#include "enemy_6.h"
#include "bullet_2.h"

#include "enemy_7.h"
#include "shadow.h"

#include "enemy_sign.h"

#include "enemy_8.h"
#include "spiral_1.h"

#include "enemy_9.h"
#include "bullet_3.h"

#include "enemy_10_warning.h"
#include "enemy_10_normal.h"
#include "rocket_3.h"
#include "oskolok.h"

#include "cash.h"
#include "game_over_text.h"
#include "next_track.h"

class GENERAL : public QObject
{
    Q_OBJECT
private:
    QGraphicsView *view;
    SCENE *scene;
    Shuttle *shuttle;

    bool shuttle_life;

//time lines
    QTimeLine *tl_anim_tiles;

    QTimeLine *tl_shuttle_bullets;

    QTimeLine *tl_shuttle_gatling_spawn;
    QTimeLine *tl_shuttle_cannon_spawn;

    QTimeLine *global_tl;

    bool shuttle_cannon_activated;

//тайлы
    TILES *bg_tile;
    TILES *bg_tile_cover;

//края
    TILES *bg_edge;
    TILES *bg_edge_cover;

//облака 1
    DECORATIONS *dec_clowds_1;
    DECORATIONS *dec_clowds_1_cover;

//облака 2
    DECORATIONS *dec_clowds_2;
    DECORATIONS *dec_clowds_2_cover;

//облака 3
    DECORATIONS *dec_clowds_3;
    DECORATIONS *dec_clowds_3_cover;

//HUD
    HUD *hud;

//HUD TEXT
    STAGE_TEXT *stage_text;
    TO_BE_CONTINUED_TEXT *to_be_continued_text;


//MENU
    MAIN_MENU *menu;

//Timer
    int id_timer;                                                           // id таймера для добавления врагов

    CASH * cash;

    SOUND_POWER *sound;

public:
    explicit GENERAL();

    void Start();

    void init();
    void timerEvent(QTimerEvent *);

    ~GENERAL();

public slots:

    void slot_keys_pressed();

    void slot_menu_visible();

    void slot_shuttle_fire(WEAPON_TYPE type);
    void slot_shuttle_fire_finish(WEAPON_TYPE type);

    void slot_gatling_spawn();
    void slot_cannon_spawn();
    void slot_cannon_stop();
                                                     // добавляем врагов
    void Add_Enemy_5();
    void Add_Rocket_1(QPoint r);
    void Add_Rocket_2(QPoint r, bool left_orientation);
    void Add_Bullet(QPoint begin);
    void Add_Bullet_2(bool razlet_left, int angle_attacks, bool stvol_left, QPoint my_coords);
    void Add_Shadow_Enemy_7();
    void Add_Spiral_1(QPoint r, bool left_orientation);
    void Add_Bullet_3(QPoint b);
    void Add_Oskolok();

    void Enemy_1_Now();
    void Enemy_2_Now();
    void Enemy_3_Now();
    void Enemy_4_Now();
    void Enemy_5_Now();
    void Enemy_6_Now();
    void Enemy_7_Now();
    void Enemy_8_Now();
    void Enemy_9_Now();
    void Enemy_10_Now();

    void LvL_1_Start();

    void menu_item_pressed(MENU_ITEM_TYPE type);
    void Shuttle_die();

    void Delete_Controller(QGraphicsObject *temp);

    void load_num_explosions();

    void slot_bg_mission_to_water();
    void slot_bg_mission_to_city();

signals:


};

#endif // GENERAL_H
